#ifndef MODEL_FILE_LOADER_H
#define MODEL_FILE_LOADER_H

#include <memory>
#include <vector>
#include <string>
#include "DataException.h"

using namespace std;

namespace geom
{
	class PolyObject;
}

namespace dataengine
{
	/** Base class for all methods to load models from files */
	class ModelFileManager
	{
		protected:
			/** File to load the model from */
			string m_filename;
			/** Utility function to check if the expected string is the same as the received one */
			void checkToken(string expected, string received) throw (DataException);
		public:
			/** Constructor */
			ModelFileManager(string filename) throw():m_filename(filename){}
			/** Destructor */
			virtual ~ModelFileManager() throw(){}
			/** Should check if the file can be loaded */
			virtual bool canLoadFile() throw() = 0;
			/** Should load the model from the file */
			virtual auto_ptr< geom::PolyObject > loadFile() throw (DataException) = 0;
			/** Should save the model to a file */
			virtual void saveToFile(const geom::PolyObject &v) throw (DataException) = 0;
	};
}
#endif
